package com.springboot.demo.design.pattern.listen;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

/**
 * 创建账户处理器
 *
 * @author supu
 * @date 2019-07-02 17:54
 **/
@Component
public class CreateAccountHandler<T> implements Handler<T> {
    @Resource
    private ListenerHolder<ListenerContext> createAccountListenerHolder;

    @Override
    public void handle(T data) {
        ListenerContext listenerContext = new ListenerContext<>(data);
        createAccountListenerHolder.listen(listenerContext);
    }
}
